package com.sca.order.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sca.order.entity.enums.OrderStateEnum;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author liuxianfei
 * @since 2020/11/3 10:45
 */
@Setter
@Getter
@TableName("sca_o_order")
public class Order extends AbstractEntity<Order> {

    private static final long serialVersionUID = 4824129186378119904L;

    /**
     * 下单用户id
     */
    private Integer userId;

    /**
     * 订单编号
     */
    private String orderNum;

    /**
     * 订单状态
     */
    private OrderStateEnum status;

    /**
     * 商品id
     */
    private Long goodId;

    /**
     * 商品数量
     */
    private Integer num;

    /**
     * 商品单价
     */
    private BigDecimal unitPrice;

    /**
     * 订单总价
     */
    private BigDecimal amount;

    /**
     * 订单实付金额
     */
    private BigDecimal finalAmount;

    private LocalDateTime createTime;
    private LocalDateTime updateTime;

    /**
     * 0：有效，1：无效
     */
    @TableField("is_delete")
    private Boolean del;

}
